Conversation
09e132f to
a07ab90
Compare
|
I tried the fix in gitlab CI, it passed on 3 different versions of VCS. |
|
Hello @nookfoo @mtravaillard , These If there was a solution to get rid of the |
|
I think we either need to always create the default target (remove the NO_RUN_TARGET option) and then let the user build on top of it (e.g., retrieve the working dir of the target and create it's own target) or use the hack we have now. |
|
@nookfoo @mtravaillard any update? Can we find a nicer solution than using these |
|
I haven't found anything yet, cmake will use cd anyways to run some commands. |
Just to clarify why I had to add SoCMake/cmake/sim/siemens/questasim.cmake Line 179 in e152015 Its correct what you are saying that CMake normally adds SoCMake/cmake/sim/siemens/questasim.cmake Lines 168 to 174 in e152015 If someone uses the Better option (cross-platform) would be to use |
|
I guess CMake does not expose the WORKING_DIRECTORY of a target as an accessible property. But what we could do is always create the base target and add our own custom property, for example:
Then we could retrieve this information later in the flow knowing the target name. What I don't really like is that it creates a target that you may not want/needed (maybe even not working on its own) by always creating the target. |
|
Reviewing the code, I think we can remove the In the cocotb function, this is simple because we directly call xcelium, so we already know In other projects, such as SoCs, we usually use this to add tests via CMake/CTest. In that scenario as well, we can easily determine the working directory because we typically pass it to the simulator function (e.g., xcelium or verilator). Still, the |
|
The Then, we could also return
For now, we could still return |
|
@Risto97 Any comment? If not, @mtravaillard could you try removing it and see if everything works? |
|
Sorry, I haven't check yet. The issue is that this change would break flows, as I have also in few places where I use this mechanism to add additional arguments to the simulation run command. Your solution would work, but it is more complicated from user perspective, as if they don't take into account the Let me check this hopefully this week and I will see how easy it is to use this new variable. |
|
Hello, I tried to play with this, and it does seem like it would not be crazy complicated to use this. |
|
I have removed the cd and so far i haven't noticed any difference, when running the examples, for xcelium, vcs and questa. I have also noticed, that for some simulator, for examples vcs.cmake, we still have both variable set, SoCMake/cmake/sim/synopsys/vcs.cmake Lines 220 to 222 in 2888e37 And for others, there is only SIM_RUN_CMD set, like in :iverilog ghdl vivado Everything works correctly for now with those 2 names but maybe we should keep one name only as they seems to be the same thing just some have been renamed... |
Changes
Setting sim_run_cmd was broken for coco xcelium, due to new variable name SOCMAKE_SIM_RUN_CMD set in simulator functions.
Additionally for xcelium, due to
cd OUTDIRinsertion, prepending of PYTHONPATH or MODULE tosim_run_cmdin cocotb function did not work. Added a small check to insert these variables into the command after a possiblecd.ToDo
sim_run_cmdstill seems to set properly for other simulators. This is due to it still being set or both variable names: https://github.com/HEP-SoC/SoCMake/blob/develop/cmake/sim/synopsys/vcs.cmake#L180. @mtravaillard maybe you could check of this needs to be updated?